const Layout = () => import("@/layout/index.vue");

/**
 * redirect: noredirect        当设置 noredirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'          设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * permi                       //当前页面的权限
 * meta : {
  hidden: true              当设置 true 的时候该路由不会再侧边栏出现 如404，login等页面(默认 false)

  alwaysShow: true          当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式，
                只有一个时，会将那个子路由当做根路由显示在侧边栏，
                若你想不管路由下面的 children 声明的个数都显示你的根路由，
                你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，
                一直显示根路由(默认 false)
  breadcrumb: false         如果设置为false，则不会在breadcrumb面包屑中显示(默认 true)

  title: 'title'            设置该路由在侧边栏和面包屑中展示的名字

  icon: 'svg-name'          设置该路由的图标

  webSetting                引用设置里面的数据
  }
 **/

export const routes = [
    {
        path: "/login",
        name: "login",
        component: () => import("@/views/login/index.vue"),
        meta: { title: "登录", hidden: true }
    },

    {
        path: "",
        name: "customerManagement",
        component: Layout,
        meta: { title: "客户管理", icon: "EachApp_yonghu", alwaysShow: true, hidden: false },
        children: [
            {
                path: "/customer/:id",
                name: "customerName",
                component: () => import("@/views/customer/index/index.vue"),
                meta: { title: "客户", icon: "EachApp_yonghu", hidden: true }
            },
            {
                path: "/addCustomer",
                name: "addCustomer",
                component: () => import("@/views/customer/index/components/addCustomer.vue"),
                meta: { title: "新增客户", icon: "EachApp_yonghu", hidden: true }
            }
        ]
    },
    {
        path: "",
        name: "webSetting",
        component: Layout,
        meta: { title: "客户管理", icon: "EachApp_xiansuo", webSetting: true, breadcrumb: false },
        children: [
            {
                path: "/dataModel",
                name: "dataModel",
                component: () => import("@/views/dataModel/index.vue"),
                meta: { title:'数据模型', icon: "EachApp_xiansuo",breadcrumb:['dataModel'] },
            },
            {
                path: "/fieldModel",
                name: "fieldModel",
                component: () => import("@/views/fieldModel/index.vue"),
                meta: { title: '字段模型', icon: "EachApp_quanbu",breadcrumb:['fieldModel'] },
            },
            {
                path: "/settingField",
                name: "settingField",
                component: () => import("@/views/settingField/index.vue"),
                meta: { title: "配置", icon: "EachApp_xiansuo", hidden: true,breadcrumb:['dataModel','settingField'] }
            },
            {
                path: "/settingFieldDetail",
                name: "settingFieldDetail",
                component: () => import("@/views/settingFieldDetail/index.vue"),
                meta: { title: "配置详情", icon: "EachApp_xiansuo", hidden: true,breadcrumb:['dataModel','settingField','settingFieldDetail'] }
            },

            {
                path: "/settingRoleDetail",
                name: "settingRoleDetail",
                component: () => import("@/views/settingRoleDetail/index.vue"),
                meta: { title: "权限配置", icon: "EachApp_xiansuo", hidden: true }
            }
        ]
    },
    {
        path: '/:catchAll(.*)',
        name: "404",
        component: () => import('../App.vue')//这个是我自己的路径
    },
]